package com.zll.exam;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String numStr = scan.nextLine();
            String[] numsStr = numStr.split(" ");
            int[] nums = new int[numsStr.length];
            for (int i = 0; i < numsStr.length; i++) {
                nums[i] = Integer.parseInt(numsStr[i]);
            }
            System.out.println(check(nums));
        }
    }

    public static int check(int[] nums){
        int max = 0;
        for(int i=0;i<nums.length;i++){
            int num = nums[i];
            for(int j=i+2;j< nums.length;j++){
                if(i==0 && j==nums.length-1){
                    break;
                }
                num += nums[j];
            }
            max = Math.max(max, num);
        }
        return max;
    }
}
